home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 187_01 / bldlib.bat < prev    next >
DOS Batch File  |  1986-03-08  |  2KB  |  88 lines

  1. if x%1==x set f1=csubrs
  2. if NOT x%1==x set f1=%1
  3. if x%2==x set f2=%f1%
  4. if NOT x%2==x set f2=%2
  5. if x%3==x set f3=c:\c\
  6. if NOT x%3==x set f3=%3
  7. if NOT exist %f1%.arc goto noarc
  8. if exist %f2%.s echo %f2%.s exists, press ENTER to continue or ^C to abort
  9. if exist %f2%.s pause 
  10. echo .      >error.lst
  11. echo .      >>error.lst
  12. echo The following routines had errors and were not added to the library: >>error.lst
  13. echo      (see ERROR.LST if you wish further processing)  >>error.lst
  14. echo .      >>error.lst
  15. rem
  16. rem build bat file to compile c subroutines
  17. rem
  18. echo echo off >temp.bat
  19. echo arc e %f1% %%1.c >>temp.bat
  20. echo echo %%1.c ">>error.lst" >>temp.bat
  21. echo %f3%c88 %%1 -i%f3% ">>error.lst" >>temp.bat
  22. rem
  23. echo erase %%1.c >>temp.bat
  24. echo if NOT errorlevel 1 echo %%1 ">>temp.inp" >>temp.bat
  25. chg " . <temp.bat >sxc.bat
  26. rem
  27. rem build bat file to assemble assembly subroutines
  28. rem
  29. echo echo off >temp.bat
  30. echo arc e %f1% %%1.a >>temp.bat
  31. echo echo %%1.a ">>error.lst" >>temp.bat
  32. echo %f3%asm88 %%1 -i%f3% ">>error.lst" >>temp.bat
  33. rem
  34. echo erase %%1.a >>temp.bat
  35. echo if NOT errorlevel 1 echo %%1 ">>temp.inp" >>temp.bat
  36. chg " . <temp.bat >sxa.bat
  37. rem
  38. rem build bat file to drive compile c subroutines
  39. rem
  40. echo echo off >temp1.bat
  41. arc l %f1% *.c | grep @.c | trunc . >temp.csr
  42. chg ^.*$ @%%comspec@%%#@/csxc@.bat#& <temp.csr >>temp1.bat
  43. rem
  44. rem build bat file to drive assemble assembly subroutines
  45. rem
  46. echo echo off >temp2.bat
  47. arc l %f1% *.a | grep @.a | trunc . >temp.csr
  48. chg ^.*$ @%%comspec@%%#@/csxa@.bat#& <temp.csr >>temp2.bat
  49. rem
  50. rem compile all c and assembly subroutines using created stuff
  51. rem
  52. %comspec% /ctemp1.bat
  53. %comspec% /ctemp2.bat
  54. rem
  55. rem build input file for lib88 to build the *.s library
  56. rem
  57. copy temp.inp temp2.inp
  58. echo -o%f2% >>temp2.inp
  59. echo -p%f2%.map >>temp2.inp
  60. rem
  61. rem link it all into a new library
  62. rem
  63. %f3%lib88 -ftemp2.inp
  64. rem
  65. rem Show which routines had errors
  66. rem
  67. more <error.lst 
  68. rem
  69. rem erase all the temporary files
  70. rem
  71. echo To erase the temporary files, press ENTER, else press ^C....
  72. pause 
  73. erase sxc.bat
  74. erase sxa.bat
  75. erase temp.cs?
  76. erase temp?.bat
  77. erase temp2.inp
  78. chg ^[A-Z0-9_]* xel#&@.o <temp.inp >temp1.bat
  79. %comspec% /ctemp1.bat
  80. erase temp.inp
  81. erase temp1.bat
  82. goto end
  83. :noarc
  84. echo %f1%.arc does not exist, aborting....
  85. :end
  86. set f1=
  87. set f2=
  88.